package com.cloud.api.config;

import com.cloud.api.annotation.EnumNotNull;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * @author 杨斌
 * 2024-08-30/8/2024
 */
public class EnumNotNullValidator implements ConstraintValidator<EnumNotNull, Enum> {

    @Override
    public void initialize(EnumNotNull constraintAnnotation) {
    }

    @Override
    public boolean isValid(Enum value, ConstraintValidatorContext context) {
        return value != null;
    }
}
